home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1997 #1
/
Amiga Plus CD - 1997 - No. 01.iso
/
pd
/
programmierung
/
installproged
/
macros
/
help.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1996-03-11
|
2KB
|
114 lines
/*
Help.rexx
This Rexx Macro searches for word under cursor in your autodocs.
To use it you have to follow these steps:
1) convert autodocs in amigaguide format using AD2AG utility
(you can found it in developers' disks)
2) Put amigaguide files in a directory and assign it "DOCS:"
3) Create an amigaguide file named "NULL" in "DOCS:"
@database "NULL"
@Node Main ""
@EndNode
4) Add DOCS: in your AmigaGuide paths
SetEnv AmigaGuide/PATH DOCS:
*/
OPTIONS RESULTS
address 'PED_AREXX'
IF ~SHOW('L','amigaguide.library') THEN
CALL ADDLIB('amigaguide.library',0,-30)
QUERY MEMCURSORCOL
ncolonna=result+1
QUERY LINE
riga=result
i=ncolonna+1
DO WHILE i>0
i=i-1
IF i=0 THEN BREAK
c=SUBSTR(riga,i,1)
ok=0
IF c>='a' THEN IF c<='z' THEN ok=1
IF c>='A' THEN IF c<='Z' THEN ok=1
IF c>='0' THEN IF c<='9' THEN ok=1
IF c='_' THEN ok=1
IF ok=0 THEN BREAK
END
word=""
DO j=i+1 to 1000
c=SUBSTR(riga,j,1)
ok=0
IF c>='a' THEN IF c<='z' THEN ok=1
IF c>='A' THEN IF c<='Z' THEN ok=1
IF c>='0' THEN IF c<='9' THEN ok=1
IF c='_' THEN ok=1
IF ok=0 THEN BREAK
word=word||c
END
/* See if the Autodoc cross-reference table is loaded */
line = GetXRef("OpenWindow()")
IF line = 10 THEN DO
/* The Autodoc table wasn't loaded, so load it. */
CALL LoadXRef("docs:autodocs.xref")
END
/* See if the word is in the cross-reference table */
function = word
xref = 0
line = GetXRef(function)
IF line = 10 THEN DO
/* Add the parens to the name */
function = word||"()"
/* Try again */
line = GetXRef(function)
IF line = 10 THEN DO
function = word
END
ELSE DO
xref = 1
END
END
ELSE DO
xref = 1
END
linea=WORD(line,4)
/* See if we have an Autodoc viewing window open */
IF ~SHOW('P','AUTODOCS') THEN DO
ADDRESS COMMAND "run <>nil: amigaguide docs:NULL portname AUTODOCS pubscreen PED_SCREEN"
ADDRESS COMMAND 'sys:rexxc/waitforport AUTODOCS'
ADDRESS COMMAND 'wait 1'
END
/* See if we are trying to load a database or a document */
IF xref = 0 THEN cmd = "LINK "||function||"/main"
IF xref = 1 THEN cmd = "LINK "||function||" "||linea
/* Align the window */
ADDRESS AUTODOCS cmd
/* I want it to come to the front, because I have limited space */
ADDRESS AUTODOCS "windowtofront"
EXIT